#!/bin/bash

#Authors:
#  Bruno Goncalves Araujo <www.biglinux.com.br>
#
#License: GPLv2 or later
#################################################


. /usr/share/bigcontrolcenter/default/theme-categories.sh.htm

#Translation
export TEXTDOMAINDIR="/usr/share/locale-langpack"
export TEXTDOMAIN=bigcontrolcenter-start-install-remove

echo '
<script language="JavaScript">
window.resizeTo(640,480);
function NoResize(){
  window.resizeTo(640,480);
}
</script>
'

title=$"Wine"
apply=$"Aplicar"
back=$"Voltar"
close=$"Sair"


. /usr/share/bigcontrolcenter/default/theme.sh.htm

cat << EOF
	<script type="text/javascript" src="/usr/share/bigcontrolcenter/default/js/jquery-1.3.2.min.js"></script>


	<script type="text/javascript">
	\$(function() {
		\$("#tabs").tabs({
			event: 'mouseover'
		})
	});

	if (document.images) {
	buttonUp = new Image(); buttonUp.src = "/usr/share/bigcontrolcenter/default/images/category-background.png";
	buttonDown = new Image(); buttonDown.src = "$(echo $HOME)/.bigcontrolcenter/category-background-over.png";
	}

	function turn_off(cell) {
	if (document.images != null) {
	cell.style.backgroundImage = "url('" + buttonUp.src + "')";
	}
	}

	function turn_on(cell) {
	if (document.images != null) {
	cell.style.backgroundImage = "url('" + buttonDown.src + "')";
	}
	}

  </script>

EOF


echo "<title>$title</title><body onResize=\"NoResize();\">"

#header
open_header
echo "$title" '</font><br>' $"Configurar o Wine."
close_header


#O uso do echo pode ser separado em diversos pedacoes dentro do mesmo comando
#O uso de aspas simples faz o sistema exibir exatamente o que esta escrito
#Quando se utiliza aspas duplas o sistema executa algumas partes do codigo antes de passar a resposta, entre essas execucoes inclui a interpretacao de variaveis
#Para incluir textos a serem exibidos ao usuario utilize aspas duplas com $ antes, para que funcione o sistema de tradução, exemplo: $"texto"
#No exemplo abaixo o memso comando echo foi aberto e fechado diversas vezes de acordo com a necessidade, aspas simples, duplas e duplas com traducao.
echo '<center><table width=500><tr><td>'



    echo '<a href="/usr/share/bigbashview/run.run?winecfg">'"<table onmouseout=\"turn_off(this)\" onmouseover=\"turn_on(this)\" $bigbash_categories_background_config background=$bigbash_categories_background><tr><td width=30><img src=configure.png></td>"'<td valign="middle">'"$bigbash_categories_font" $"Configurador do Wine" " </font></td></tr></table></a>"


echo '</td><td width=100%></td><td>'


    echo "<a href=/usr/share/bigbashview/run.run?xdg-open=/$HOME/.wine/drive_c>""<table onmouseout=\"turn_off(this)\" onmouseover=\"turn_on(this)\" $bigbash_categories_background_config background=$bigbash_categories_background><tr><td width=30><img src=folder.png></td>"'<td valign="middle">'"$bigbash_categories_font" $"Abrir pasta com arquivos do Wine" " </font></td></tr></table></a>"

echo '</td></tr><tr><td>'











    echo '<a href="/usr/share/bigbashview/run.run?regedit">'"<table onmouseout=\"turn_off(this)\" onmouseover=\"turn_on(this)\" $bigbash_categories_background_config background=$bigbash_categories_background><tr><td width=30><img src=regedit.png></td>"'<td valign="middle">'"$bigbash_categories_font" $"Editor de registros Regedit" " </font></td></tr></table></a>"


echo '</td><td width=100%></td><td>'


    echo "<a href=/usr/share/bigbashview/run.run?winefile>""<table onmouseout=\"turn_off(this)\" onmouseover=\"turn_on(this)\" $bigbash_categories_background_config background=$bigbash_categories_background><tr><td width=30><img src=winefile.png></td>"'<td valign="middle">'"$bigbash_categories_font" $"Gerenciador de arquivos do Wine" " </font></td></tr></table></a>"

echo '</td></tr><tr><td>'













    echo '<a href="/usr/share/bigcontrolcenter/categories/start/install-remove/reboot-wine.run">'"<table onmouseout=\"turn_off(this)\" onmouseover=\"turn_on(this)\" $bigbash_categories_background_config background=$bigbash_categories_background><tr><td width=30><img src=reboot.png></td>"'<td valign="middle">'"$bigbash_categories_font" $"Simular que o Windows esta sendo reiniciado" " </font></td></tr></table></a>"


echo '</td><td width=100%></td><td>'


    echo "<a href=/usr/share/bigcontrolcenter/categories/start/install-remove/remove-wine.run>""<table onmouseout=\"turn_off(this)\" onmouseover=\"turn_on(this)\" $bigbash_categories_background_config background=$bigbash_categories_background><tr><td width=30><img src=remove.png></td>"'<td valign="middle">'"$bigbash_categories_font" $"Apagar arquivos pessoais do Wine" " </font></td></tr></table></a>"


echo '</td></tr></table>'


echo '<center><table width=95%><tr><td><br><br><br><br><br><br><br><br>'


echo  "<b><font color=red>*</font></b> "$"As alteracoes feitas nesse painel afetam os programas instalados no Wine, mas nao incluenciam os instalados utilizando o PlayOnLinux." 

echo '</td></tr></table>'


echo "</font></div><div id=\"rodape\"><button type=button  onClick=\"location.replace('install-remove.sh.htm')\">   <img src=\"/usr/share/bigcontrolcenter/default/images/ok.png\" style=\"vertical-align:top\" />  $back   </button> 
<button type=button onClick= parent.location='/usr/share/bigbashview/exemplo2.sh.htm?close=True'>   <img src=\"/usr/share/bigcontrolcenter/default/images/cancel.png\" style=\"vertical-align:top\"  />  $close     </button></form></div></body>"
